home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / newagu / agu.bst (.txt) < prev    next >
LaTeX Document  |  1993-06-16  |  23KB  |  974 lines

  1. %% BiBTeX AGU bibliography style  for BiBTeX 0.99a
  2. %% Copyright (C) 1990,1992 Patrick W. Daly, all rights reserved
  3. %%   ====  1990 May 30 =====
  4. %%   ====  1992 November 23 ==== (see list of changes below)
  5. %%   by P. W. Daly, 
  6. %%      Max-Planck_Institut f\"ur Aeronomie,
  7. %%      D-3411 Katlenburg-Lindau,  
  8. %%      F. R. Germany
  9. %%  This is a modification of NATSCI.BST by Stephen Gildea.
  10. %%  Differences are that for the label the author names are italicized and
  11. %%  that the year goes in paratheses after the authors. 
  12. %%  e.g.  \bibitem[{\it Smith and Weston}(1989)]{key}
  13. %%  Citation is to appear either as {\it Smith and Weston} [1989]
  14. %%  or as [{\it Smith and Weston}, 1989] depending on whether
  15. %%  \cite{key} or \cite[]{key} is given. 
  16. %%  The reference appears listed as follows:
  17. %%  Smith, R. G., E. P. Weston, and F. L. Harvey, Title, {\it Journal}, 
  18. %%   {\it 34}, 321--324, 1989. 
  19. %%  Changes to \thebibliography that are necessary to bring this about:
  20. %%\def\thebibliography#1{\section*{\refname
  21. %%  \@mkboth{\refname}{\refname}}\parindent \z@
  22. %%  \immediate\write\@auxout{\begingroup\string\paractive}\list
  23. %% {\arabic{enumiv}.}{\itemsep=0pt \parsep=0pt %default label for NUM styles
  24. %% \usecounter{enumiv}\@bibsetup}%
  25. %% \def\newblock{\hskip .11em plus .33em minus -.07em}%
  26. %% \sloppy
  27. %% \sfcode`\.=1000\relax}
  28. %%\def\endthebibliography{%
  29. %%  \immediate\write\@auxout{\endgroup}%
  30. %%  \def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
  31. %%  \endlist\vskip-\lastskip}
  32. %%\def\@bibsetup#1{\leftmargin=1em\itemindent=-\leftmargin}
  33. %%\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  34. %%  \def\@citea{}\@cite{\@for\@citeb:=#2\do
  35. %%    {\@citea\def\@citea{\@citesep}\@ifundefined
  36. %%       {b@\@citeb}{{\bf ?}\@warning
  37. %%       {Citation `\@citeb' on page \thepage \space undefined}}%
  38. %%{\csname b@\@citeb\endcsname}}}{#1}}
  39. %%\def\@citesep{; }
  40. %%\def\paractive{\catcode`\(=\active \catcode`\)=\active }
  41. %%{\paractive
  42. %%\gdef\@cite#1#2{{\paractive\if@tempswa[#2\def({,\ }\let)=\relax#1]\else
  43. %%\gdef({\ [}\def){]}#1\fi}}
  44. %%\def\@biblabel#1{\hfill}
  45. % **********************************************************
  46. % ***** This will not work with BibTeX 0.98 or earlier *****
  47. % **********************************************************
  48. %  Changes made 1992 November 23 to comply with AGU 
  49. %  --  extra labels (the `a' in 1992a) in italics 
  50. %  --  `PhD' now written as `Ph.D'
  51. %  --  `Technical Report' is now `technical report' (not capitalized)
  52. %  --  format.date changed so month not written if volume present
  53. %  --  format.pages changed so `p.' and `pp.' not written
  54. %%                                                 -- PWD --
  55. %% BibTeX `natsci' family
  56. ENTRY
  57.   { address
  58.     author
  59.     booktitle
  60.     chapter
  61.     edition
  62.     editor
  63.     howpublished
  64.     institution
  65.     journal
  66.     key
  67.     month
  68.     note
  69.     number
  70.     organization
  71.     pages
  72.     publisher
  73.     school
  74.     series
  75.     title
  76.     type
  77.     volume
  78.     year
  79.   { label extra.label sort.label }
  80. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  81. FUNCTION {init.state.consts}
  82. { #0 'before.all :=
  83.   #1 'mid.sentence :=
  84.   #2 'after.sentence :=
  85.   #3 'after.block :=
  86. STRINGS { s t }
  87. FUNCTION {output.nonnull}
  88. { 's :=
  89.   output.state mid.sentence =
  90.     { ", " * write$ }
  91.     { output.state after.block =
  92.         { ", " * write$
  93.           newline$
  94.           "\newblock " write$
  95.         }
  96.         { output.state before.all =
  97.             'write$
  98.             { add.period$ " " * write$ }
  99.           if$
  100.         }
  101.       if$
  102.       mid.sentence 'output.state :=
  103.     }
  104.   if$
  105. FUNCTION {output}
  106. { duplicate$ empty$
  107.     'pop$
  108.     'output.nonnull
  109.   if$
  110. FUNCTION {output.check}
  111. { 't :=
  112.   duplicate$ empty$
  113.     { pop$ "empty " t * " in " * cite$ * warning$ }
  114.     'output.nonnull
  115.   if$
  116. FUNCTION {output.bibitem}
  117. { newline$
  118.   "\bibitem[" write$
  119.   label write$
  120.   "]{" write$
  121.   cite$ write$
  122.   "}" write$
  123.   newline$
  124.   before.all 'output.state :=
  125. FUNCTION {fin.entry}
  126. { add.period$
  127.   write$
  128.   newline$
  129. FUNCTION {new.block}
  130. { output.state before.all =
  131.     'skip$
  132.     { after.block 'output.state := }
  133.   if$
  134. FUNCTION {new.sentence}
  135. { output.state after.block =
  136.     'skip$
  137.     { output.state before.all =
  138.         'skip$
  139.         { after.sentence 'output.state := }
  140.       if$
  141.     }
  142.   if$
  143. FUNCTION {not}
  144. {   { #0 }
  145.     { #1 }
  146.   if$
  147. FUNCTION {and}
  148. {   'skip$
  149.     { pop$ #0 }
  150.   if$
  151. FUNCTION {or}
  152. {   { pop$ #1 }
  153.     'skip$
  154.   if$
  155. FUNCTION {new.block.checka}
  156. { empty$
  157.     'skip$
  158.     'new.block
  159.   if$
  160. FUNCTION {new.block.checkb}
  161. { empty$
  162.   swap$ empty$
  163.   and
  164.     'skip$
  165.     'new.block
  166.   if$
  167. FUNCTION {new.sentence.checka}
  168. { empty$
  169.     'skip$
  170.     'new.sentence
  171.   if$
  172. FUNCTION {new.sentence.checkb}
  173. { empty$
  174.   swap$ empty$
  175.   and
  176.     'skip$
  177.     'new.sentence
  178.   if$
  179. FUNCTION {field.or.null}
  180. { duplicate$ empty$
  181.     { pop$ "" }
  182.     'skip$
  183.   if$
  184. FUNCTION {emphasize}
  185. { duplicate$ empty$
  186.     { pop$ "" }
  187.     { "{\it " swap$ * "}" * }
  188.   if$
  189. INTEGERS { nameptr namesleft numnames }
  190. FUNCTION {format.names}
  191. { 's :=
  192.   #1 'nameptr :=
  193.   s num.names$ 'numnames :=
  194.   numnames 'namesleft :=
  195.     { namesleft #0 > }
  196.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  197.       nameptr #1 >
  198.         { namesleft #1 >
  199.             { ", " * t * }
  200.             { numnames #2 >
  201.                 { "," * }
  202.                 'skip$
  203.               if$
  204.               t "others" =
  205.                 { " et~al." * }
  206.                 { " and " * t * }
  207.               if$
  208.             }
  209.           if$
  210.         }
  211.         't
  212.       if$
  213.       nameptr #1 + 'nameptr :=
  214.       namesleft #1 - 'namesleft :=
  215.     }
  216.   while$
  217. FUNCTION {format.names.reverse1}
  218. { 's :=
  219.   #1 'nameptr :=
  220.   s num.names$ 'numnames :=
  221.   numnames 'namesleft :=
  222.     { namesleft #0 > }
  223.     {
  224.       nameptr #1 >
  225.         { 
  226.           s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  227.           namesleft #1 >
  228.             { ", " * t * }
  229.             { t "others" =
  230.                 { " et~al." * }
  231.                 { ", and " * t * } %AGU wants comma even for two authors!
  232.               if$
  233.             }
  234.           if$
  235.          }
  236.          { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ }
  237.       if$
  238.       nameptr #1 + 'nameptr :=
  239.       namesleft #1 - 'namesleft :=
  240.     }
  241.   while$
  242. FUNCTION {format.authors}
  243. { author empty$
  244.     { "" }
  245.     { author format.names.reverse1 }
  246.   if$
  247. FUNCTION {format.editors}
  248. { editor empty$
  249.     { "" }
  250.     { editor format.names
  251.       editor num.names$ #1 >
  252.         { " (Eds.)" * }
  253.         { " (Ed.)" * }
  254.       if$
  255.     }
  256.   if$
  257. FUNCTION {format.title}
  258. { title empty$
  259.     { "" }
  260.     { title "t" change.case$ }
  261.   if$
  262. FUNCTION {n.dashify}
  263. { 't :=
  264.     { t empty$ not }
  265.     { t #1 #1 substring$ "-" =
  266.         { t #1 #2 substring$ "--" = not
  267.             { "--" *
  268.               t #2 global.max$ substring$ 't :=
  269.             }
  270.             {   { t #1 #1 substring$ "-" = }
  271.                 { "-" *
  272.                   t #2 global.max$ substring$ 't :=
  273.                 }
  274.               while$
  275.             }
  276.           if$
  277.         }
  278.         { t #1 #1 substring$ *
  279.           t #2 global.max$ substring$ 't :=
  280.         }
  281.       if$
  282.     }
  283.   while$
  284. % Month not printed if volume present 
  285. % Extra label (a, b, ...) on date is italicized -- 92 Nov 23 -- PWD
  286. FUNCTION {format.date}
  287. { year empty$
  288.     { month empty$
  289.         { "" }
  290.         { "there's a month but no year in " cite$ * warning$
  291.           month
  292.         }
  293.       if$
  294.     }
  295.     { month empty$
  296.         'year 
  297.         { volume empty$
  298.             { month " " * year * }
  299.             'year
  300.           if$
  301.         }
  302.       if$
  303.       extra.label emphasize *
  304.     }
  305.   if$
  306. FUNCTION {format.btitle}
  307. { title emphasize
  308. FUNCTION {tie.or.space.connect}
  309. { duplicate$ text.length$ #3 <
  310.     { "~" }
  311.     { " " }
  312.   if$
  313.   swap$ * *
  314. FUNCTION {either.or.check}
  315. { empty$
  316.     'pop$
  317.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  318.   if$
  319. FUNCTION {format.bvolume}
  320. { volume empty$
  321.     { "" }
  322.     { "vol." volume tie.or.space.connect
  323.       series empty$
  324.         'skip$
  325.         { " of " * series emphasize * }
  326.       if$
  327.       "volume and number" number either.or.check
  328.     }
  329.   if$
  330. FUNCTION {format.number.series}
  331. { volume empty$
  332.     { number empty$
  333.         { series field.or.null }
  334.         { output.state mid.sentence =
  335.             { "number" }
  336.             { "Number" }
  337.           if$
  338.           number tie.or.space.connect
  339.           series empty$
  340.             { "there's a number but no series in " cite$ * warning$ }
  341.             { " in " * series * }
  342.           if$
  343.         }
  344.       if$
  345.     }
  346.     { "" }
  347.   if$
  348. FUNCTION {format.edition}
  349. { edition empty$
  350.     { "" }
  351.     { output.state mid.sentence =
  352.         { edition "l" change.case$ " edition" * }
  353.         { edition "t" change.case$ " edition" * }
  354.       if$
  355.     }
  356.   if$
  357. INTEGERS { multiresult }
  358. FUNCTION {multi.page.check}
  359. { 't :=
  360.   #0 'multiresult :=
  361.     { multiresult not
  362.       t empty$ not
  363.       and
  364.     }
  365.     { t #1 #1 substring$
  366.       duplicate$ "-" =
  367.       swap$ duplicate$ "," =
  368.       swap$ "+" =
  369.       or or
  370.         { #1 'multiresult := }
  371.         { t #2 global.max$ substring$ 't := }
  372.       if$
  373.     }
  374.   while$
  375.   multiresult
  376. % remove the `p.' and `pp.' for pages -- 92 Nov 23 -- PWD
  377. FUNCTION {format.pages}
  378. { pages empty$
  379.     { "" }
  380.     { pages multi.page.check
  381.         { pages n.dashify }
  382.         { pages }
  383.       if$
  384.     }
  385.   if$
  386. FUNCTION {format.vol.num.pages}
  387. { volume field.or.null emphasize
  388.   number empty$
  389.     'skip$
  390.     { ", (" number * ")" * *
  391.       volume empty$
  392.         { "there's a number but no volume in " cite$ * warning$ }
  393.         'skip$
  394.       if$
  395.     }
  396.   if$
  397.   pages empty$
  398.     'skip$
  399.     { duplicate$ empty$
  400.         { pop$ format.pages }
  401.         { ", " * pages n.dashify * }
  402.       if$
  403.     }
  404.   if$
  405. FUNCTION {format.chapter.pages}
  406. { chapter empty$
  407.     'format.pages
  408.     { type empty$
  409.         { "chapter" }
  410.         { type "l" change.case$ }
  411.       if$
  412.       chapter tie.or.space.connect
  413.       pages empty$
  414.         'skip$
  415.         { ", " * format.pages * }
  416.       if$
  417.     }
  418.   if$
  419. FUNCTION {format.in.ed.booktitle}
  420. { booktitle empty$
  421.     { "" }
  422.     { "in " booktitle emphasize *
  423.       editor empty$
  424.         'skip$
  425.         { ", " * "edited by " * editor format.names * }
  426.       if$
  427.     }
  428.   if$
  429. FUNCTION {format.note}
  430. { duplicate$ empty$
  431.   'skip$
  432.   { 's :=
  433.     s #1 #1 substring$ 't :=
  434.     output.state mid.sentence =
  435.       { t "l" change.case$ }
  436.       { t "u" change.case$ }
  437.     if$
  438.     s #2 global.max$ substring$ *
  439. FUNCTION {empty.misc.check}
  440. { author empty$ title empty$ howpublished empty$
  441.   month empty$ year empty$ note empty$
  442.   and and and and and
  443.   key empty$ not and
  444.     { "all relevant fields are empty in " cite$ * warning$ }
  445.     'skip$
  446.   if$
  447. FUNCTION {format.thesis.type}
  448. { type empty$
  449.     'skip$
  450.     { pop$
  451.       type "t" change.case$
  452.     }
  453.   if$
  454. % write "technical report" noncapitalized -- 92 Nov 23 -- PWD
  455. FUNCTION {format.tr.number}
  456. { type empty$
  457.     { "technical report" }
  458.     'type
  459.   if$
  460.   number empty$
  461.     { "t" change.case$ }
  462.     { number tie.or.space.connect }
  463.   if$
  464. FUNCTION {format.article.crossref}
  465. { key empty$
  466.     { journal empty$
  467.         { "need key or journal for " cite$ * " to crossref " * crossref *
  468.           warning$
  469.           ""
  470.         }
  471.         { "in {\em " journal * "\/}" * }
  472.       if$
  473.     }
  474.     { "in " key * }
  475.   if$
  476.   " \cite{" * crossref * "}" *
  477. FUNCTION {format.book.crossref}
  478. { volume empty$
  479.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  480.       "in "
  481.     }
  482.     { "vol." volume tie.or.space.connect
  483.       " of " *
  484.     }
  485.   if$
  486.   editor empty$
  487.   editor field.or.null author field.or.null =
  488.     { key empty$
  489.         { series empty$
  490.             { "need editor, key, or series for " cite$ * " to crossref " *
  491.               crossref * warning$
  492.               "" *
  493.             }
  494.             { "{\em " * series * "\/}" * }
  495.           if$
  496.         }
  497.         { key * }
  498.       if$
  499.     }
  500.     'skip$
  501.   if$
  502.   " \cite{" * crossref * "}" *
  503. FUNCTION {format.incoll.inproc.crossref}
  504. { editor empty$
  505.   editor field.or.null author field.or.null =
  506.     { key empty$
  507.         { booktitle empty$
  508.             { "need editor, key, or booktitle for " cite$ * " to crossref " *
  509.               crossref * warning$
  510.               ""
  511.             }
  512.             { "in {\em " booktitle * "\/}" * }
  513.           if$
  514.         }
  515.         { "in " key * }
  516.       if$
  517.     }
  518.     { "in " }
  519.   if$
  520.   " \cite{" * crossref * "}" *
  521. FUNCTION {article}
  522. { output.bibitem
  523.   format.authors "author" output.check
  524.   format.title "title" output.check
  525.   crossref missing$
  526.     { journal emphasize "journal" output.check
  527.       format.vol.num.pages output
  528.       note format.note output
  529.       format.date "year" output.check
  530.     }
  531.     { format.article.crossref output.nonnull
  532.       format.pages output
  533.       note format.note output
  534.     }
  535.   if$
  536.   fin.entry
  537. FUNCTION {book}
  538. { output.bibitem
  539.   author empty$
  540.     { format.editors "author and editor" output.check }
  541.     { format.authors output.nonnull
  542.       crossref missing$
  543.         { "author and editor" editor either.or.check }
  544.         'skip$
  545.       if$
  546.     }
  547.   if$
  548.   format.btitle "title" output.check
  549.   crossref missing$
  550.     { format.bvolume output
  551.       format.number.series output
  552.       publisher "publisher" output.check
  553.       address output
  554.     }
  555.     { format.book.crossref output.nonnull }
  556.   if$
  557.   format.edition output
  558.   note format.note output
  559.   format.date "year" output.check
  560.   fin.entry
  561. FUNCTION {booklet}
  562. { output.bibitem
  563.   format.authors output
  564.   format.title "title" output.check
  565.   howpublished output
  566.   address output
  567.   note format.note output
  568.   format.date output
  569.   fin.entry
  570. FUNCTION {inbook}
  571. { output.bibitem
  572.   author empty$
  573.     { format.editors "author and editor" output.check }
  574.     { format.authors output.nonnull
  575.       crossref missing$
  576.         { "author and editor" editor either.or.check }
  577.         'skip$
  578.       if$
  579.     }
  580.   if$
  581.   format.btitle "title" output.check
  582.   crossref missing$
  583.     { format.bvolume output
  584.       format.chapter.pages "chapter and pages" output.check
  585.       format.number.series output
  586.       publisher "publisher" output.check
  587.       address output
  588.     }
  589.     { format.chapter.pages "chapter and pages" output.check
  590.       format.book.crossref output.nonnull
  591.     }
  592.   if$
  593.   format.edition output
  594.   note format.note output
  595.   format.date "year" output.check
  596.   fin.entry
  597. FUNCTION {incollection}
  598. { output.bibitem
  599.   format.authors "author" output.check
  600.   format.title "title" output.check
  601.   crossref missing$
  602.     { format.in.ed.booktitle "booktitle" output.check
  603.       format.bvolume output
  604.       format.number.series output
  605.       format.chapter.pages output
  606.       publisher "publisher" output.check
  607.       address output
  608.       format.edition output
  609.       note format.note output
  610.       format.date "year" output.check
  611.     }
  612.     { format.incoll.inproc.crossref output.nonnull
  613.       format.chapter.pages output
  614.       note format.note output
  615.     }
  616.   if$
  617.   fin.entry
  618. FUNCTION {inproceedings}
  619. { output.bibitem
  620.   format.authors "author" output.check
  621.   format.title "title" output.check
  622.   crossref missing$
  623.     { format.in.ed.booktitle "booktitle" output.check
  624.       format.bvolume output
  625.       format.number.series output
  626.       format.pages output
  627.       address empty$
  628.         { organization output
  629.           publisher output
  630.           note format.note output
  631.           format.date "year" output.check
  632.         }
  633.         { organization output
  634.           publisher output
  635.           address output.nonnull
  636.           note format.note output
  637.           format.date "year" output.check
  638.         }
  639.       if$
  640.     }
  641.     { format.incoll.inproc.crossref output.nonnull
  642.       format.pages output
  643.       note format.note output
  644.     }
  645.   if$
  646.   fin.entry
  647. FUNCTION {conference} { inproceedings }
  648. FUNCTION {manual}
  649. { output.bibitem
  650.   author empty$
  651.     { organization empty$
  652.         'skip$
  653.         { organization output.nonnull
  654.           address output
  655.         }
  656.       if$
  657.     }
  658.     { format.authors output.nonnull }
  659.   if$
  660.   format.btitle "title" output.check
  661.   author empty$
  662.     { organization empty$
  663.         { address output }
  664.         'skip$
  665.       if$
  666.     }
  667.     { organization output
  668.       address output
  669.     }
  670.   if$
  671.   format.edition output
  672.   note format.note output
  673.   format.date output
  674.   fin.entry
  675. FUNCTION {mastersthesis}
  676. { output.bibitem
  677.   format.authors "author" output.check
  678.   format.title "title" output.check
  679.   "Master's thesis" format.thesis.type output.nonnull
  680.   school "school" output.check
  681.   address output
  682.   note format.note output
  683.   format.date "year" output.check
  684.   fin.entry
  685. FUNCTION {misc}
  686. { output.bibitem
  687.   format.authors output
  688.   format.title output
  689.   howpublished output
  690.   note format.note output
  691.   format.date output
  692.   fin.entry
  693.   empty.misc.check
  694. % write Ph.D. instead of PhD -- 92 Nov 23 -- PWD
  695. FUNCTION {phdthesis}
  696. { output.bibitem
  697.   format.authors "author" output.check
  698.   format.btitle "title" output.check
  699.   "Ph.D. thesis" format.thesis.type output.nonnull
  700.   school "school" output.check
  701.   address output
  702.   note format.note output
  703.   format.date "year" output.check
  704.   fin.entry
  705. FUNCTION {proceedings}
  706. { output.bibitem
  707.   editor empty$
  708.     { organization output }
  709.     { format.editors output.nonnull }
  710.   if$
  711.   format.btitle "title" output.check
  712.   format.bvolume output
  713.   format.number.series output
  714.   address empty$
  715.     { editor empty$
  716.         'skip$
  717.         { organization output }
  718.       if$
  719.       publisher output
  720.       note format.note output
  721.       format.date "year" output.check
  722.     }
  723.     { editor empty$
  724.         'skip$
  725.         { organization output }
  726.       if$
  727.       publisher output
  728.       address output.nonnull
  729.       note format.note output
  730.       format.date "year" output.check
  731.     }
  732.   if$
  733.   fin.entry
  734. FUNCTION {techreport}
  735. { output.bibitem
  736.   format.authors "author" output.check
  737.   format.title "title" output.check
  738.   format.tr.number output.nonnull
  739.   institution "institution" output.check
  740.   address output
  741.   note format.note output
  742.   format.date "year" output.check
  743.   fin.entry
  744. FUNCTION {unpublished}
  745. { output.bibitem
  746.   format.authors "author" output.check
  747.   format.title "title" output.check
  748.   note format.note "note" output.check
  749.   format.date output
  750.   fin.entry
  751. FUNCTION {default.type} { misc }
  752. MACRO {jan} {"January"}
  753. MACRO {feb} {"February"}
  754. MACRO {mar} {"March"}
  755. MACRO {apr} {"April"}
  756. MACRO {may} {"May"}
  757. MACRO {jun} {"June"}
  758. MACRO {jul} {"July"}
  759. MACRO {aug} {"August"}
  760. MACRO {sep} {"September"}
  761. MACRO {oct} {"October"}
  762. MACRO {nov} {"November"}
  763. MACRO {dec} {"December"}
  764. MACRO {grl} {"Geophys. Res. Lett."}
  765. MACRO {jgr} {"J. Geophys. Res."}
  766. MACRO {aa} {"Astron. Astrophys."}
  767. MACRO {pass} {"Planet. Space Sci."}
  768. MACRO {adv} {"Adv. Space Res."}
  769. MACRO {ann} {"Annales Geophys."}
  770. MACRO {jatp} {"J. Atmos. Terr. Phys."}
  771. FUNCTION {sortify}
  772. { purify$
  773.   "l" change.case$
  774. INTEGERS { len }
  775. FUNCTION {chop.word}
  776. { 's :=
  777.   'len :=
  778.   s #1 len substring$ =
  779.     { s len #1 + global.max$ substring$ }
  780.     's
  781.   if$
  782. FUNCTION {format.label.names}
  783. { 's :=
  784.   s #1 "{vv~}{ll}" format.name$
  785.   s num.names$ duplicate$
  786.   #2 >
  787.     { pop$ " et~al." * }
  788.     { #2 <
  789.         'skip$
  790.         { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  791.             { " et~al." * }
  792.             { " and " * s #2 "{vv~}{ll}" format.name$ * }
  793.           if$
  794.         }
  795.       if$
  796.     }
  797.   if$
  798. FUNCTION {calc.label}
  799. { author empty$
  800.     { editor empty$
  801.     { key empty$
  802.         { "need a key to make a label in " cite$ * warning$
  803.           title field.or.null purify$ #1 #3 substring$
  804.         }
  805.         { key purify$ #1 #3 substring$ }
  806.       if$
  807.     }
  808.     { editor format.label.names }
  809.       if$
  810.     }
  811.     { author format.label.names }
  812.   if$
  813.   emphasize
  814.   "(" *
  815.   year field.or.null purify$
  816.   ")" *
  817.   'label :=
  818.   label sortify 'sort.label :=
  819. FUNCTION {sort.format.names}
  820. { 's :=
  821.   #1 'nameptr :=
  822.   s num.names$ 'numnames :=
  823.   numnames 'namesleft :=
  824.     { namesleft #0 > }
  825.     { nameptr #1 >
  826.         { "   " * }
  827.         'skip$
  828.       if$
  829.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  830.       nameptr numnames = t "others" = and
  831.         { "et al" * }
  832.         { t sortify * }
  833.       if$
  834.       nameptr #1 + 'nameptr :=
  835.       namesleft #1 - 'namesleft :=
  836.     }
  837.   while$
  838. FUNCTION {sort.format.title}
  839. { 't :=
  840.   "A " #2
  841.     "An " #3
  842.       "The " #4 t chop.word
  843.     chop.word
  844.   chop.word
  845.   sortify
  846.   #1 global.max$ substring$
  847. FUNCTION {author.sort}
  848. { author empty$
  849.     { key empty$
  850.         { "to sort, need author or key in " cite$ * warning$
  851.           ""
  852.         }
  853.         { key sortify }
  854.       if$
  855.     }
  856.     { author sort.format.names }
  857.   if$
  858. FUNCTION {author.editor.sort}
  859. { author empty$
  860.     { editor empty$
  861.         { key empty$
  862.             { "to sort, need author, editor, or key in " cite$ * warning$
  863.               ""
  864.             }
  865.             { key sortify }
  866.           if$
  867.         }
  868.         { editor sort.format.names }
  869.       if$
  870.     }
  871.     { author sort.format.names }
  872.   if$
  873. FUNCTION {author.organization.sort}
  874. { author empty$
  875.     { organization empty$
  876.         { key empty$
  877.             { "to sort, need author, organization, or key in " cite$ * warning$
  878.               ""
  879.             }
  880.             { key sortify }
  881.           if$
  882.         }
  883.         { "The " #4 organization chop.word sortify }
  884.       if$
  885.     }
  886.     { author sort.format.names }
  887.   if$
  888. FUNCTION {editor.organization.sort}
  889. { editor empty$
  890.     { organization empty$
  891.         { key empty$
  892.             { "to sort, need editor, organization, or key in " cite$ * warning$
  893.               ""
  894.             }
  895.             { key sortify }
  896.           if$
  897.         }
  898.         { "The " #4 organization chop.word sortify }
  899.       if$
  900.     }
  901.     { editor sort.format.names }
  902.   if$
  903. FUNCTION {presort}
  904. { calc.label
  905.   sort.label
  906.   "    " *
  907.   type$ "book" =
  908.   type$ "inbook" =
  909.     'author.editor.sort
  910.     { type$ "proceedings" =
  911.         'editor.organization.sort
  912.         { type$ "manual" =
  913.             'author.organization.sort
  914.             'author.sort
  915.           if$
  916.         }
  917.       if$
  918.     }
  919.   if$
  920.   "    "
  921.   year field.or.null sortify
  922.   "    "
  923.   title field.or.null
  924.   sort.format.title
  925.   #1 entry.max$ substring$
  926.   'sort.key$ :=
  927. ITERATE {presort}
  928. STRINGS { last.sort.label next.extra }
  929. INTEGERS { last.extra.num }
  930. FUNCTION {initialize.label}
  931. { "" 'last.sort.label :=
  932.   "" 'next.extra :=
  933.   #0 'last.extra.num :=
  934. FUNCTION {forward.pass}
  935. { last.sort.label sort.label =
  936.     { last.extra.num #1 + 'last.extra.num :=
  937.       last.extra.num int.to.chr$ 'extra.label :=
  938.     }
  939.     { "a" chr.to.int$ 'last.extra.num :=
  940.       "" 'extra.label :=
  941.       sort.label 'last.sort.label :=
  942.     }
  943.   if$
  944. % italicize the extra label -- 92 Nov 23 -- PWD
  945. FUNCTION {add.extra.label}
  946. { duplicate$
  947.   #-1 #1 substring$ ")" =
  948.     { #-2 global.max$ substring$ extra.label emphasize * ")" * }
  949.     { extra.label emphasize * }
  950.   if$
  951. FUNCTION {reverse.pass}
  952. { next.extra "b" =
  953.     { "a" 'extra.label := }
  954.     'skip$
  955.   if$
  956.   label add.extra.label 'label :=
  957.   extra.label 'next.extra :=
  958. EXECUTE {initialize.label}
  959. ITERATE {forward.pass}
  960. REVERSE {reverse.pass}
  961. FUNCTION {begin.bib}
  962. { preamble$ empty$
  963.     'skip$
  964.     { preamble$ write$ newline$ }
  965.   if$
  966.   "\begin{thebibliography}{}" write$ newline$
  967. EXECUTE {begin.bib}
  968. EXECUTE {init.state.consts}
  969. ITERATE {call.type$}
  970. FUNCTION {end.bib}
  971. { newline$
  972.   "\end{thebibliography}" write$ newline$
  973. EXECUTE {end.bib}
  974.